<!doctype html>
<html lang="en">

	<head>
		<meta charset="UTF-8"/>
		<title>HXAPIGate</title>
		<meta name="renderer" content="webkit|ie-comp|ie-stand"/>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
		<meta http-equiv="Cache-Control" content="no-siteapp" />
		<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
		<link rel="stylesheet" href="css/font.css"/>
		<link rel="stylesheet" href="css/weadmin.css"/>
		<script type="text/javascript" src="lib/layui/layui.all.js" charset="utf-8"></script>

	</head>

	<body>
		<!-- 顶部开始 -->
		<div class="container">
			<div class="logo">
				<a href="./index">HXAPIGate管理平台</a>
			</div>
			<div class="left_open">
				<i title="展开左侧栏" class="iconfont">&#xe699;</i>
			</div>
			<ul class="layui-nav right" lay-filter=""  >
				<li class="layui-nav-item to-index" id="user_name">
					<a class="loginout" >请登录</a>
				</li>
				<li class="layui-nav-item" id="logout">
					<a >操作</a>
					<dl class="layui-nav-child">
						<!-- 二级菜单 -->
						<dd>
							<a class="loginout" >退出</a>
						</dd>
					</dl>
				</li>
			</ul>
		</div>
		<!-- 顶部结束 -->
		<!-- 中部开始 -->
		<!-- 左侧菜单开始 -->
		<div class="left-nav">
			<div id="side-nav">
				<ul id="nav">
					<li>
						<a href="javascript:;">
							<i class="layui-icon">&#xe672;</i>
							<cite>权限管理</cite>
							<i class="iconfont nav_right">&#xe697;</i>
						</a>
						<ul class="sub-menu">
							<li>
								<a _href="../static/pages/authManage/roleResource/list.html">
									<i class="iconfont">&#xe6a7;</i>
									<cite>角色/资源管理</cite>
								</a>
							</li>

						</ul>
					</li>
					<li>
						<a href="javascript:;">
							<i class="layui-icon">&#xe631;</i>
							<cite>资源管理</cite>
							<i class="iconfont nav_right">&#xe697;</i>
						</a>
						<ul class="sub-menu">
							<li>
								<a _href="../static/pages/hxapiType/typelist.html">
									<i class="iconfont">&#xe6a7;</i>
									<cite>类型管理</cite>
								</a>
							</li>
							<li>
								<a _href="../static/pages/hxapi/list.html">
									<i class="iconfont">&#xe6a7;</i>
									<cite>API管理</cite>
								</a>
							</li>
						</ul>
					</li>

				</ul>
			</div>
		</div>
		<!-- <div class="x-slide_left"></div> -->
		<!-- 左侧菜单结束 -->
		<!-- 右侧主体开始 -->
		<div class="page-content">
			<div class="layui-tab tab" lay-filter="wenav_tab" id="WeTabTip" lay-allowclose="true">
				<ul class="layui-tab-title" id="tabName">
					<li>我的桌面</li>
				</ul>
				<div class="layui-tab-content">
					<div class="layui-tab-item layui-show">
						<iframe src='pages/welcome.html' frameborder="0" scrolling="yes" class="weIframe"></iframe>
					</div>
				</div>
			</div>
		</div>
		<div class="page-content-bg"></div>
		<!-- 右侧主体结束 -->
		<!-- 中部结束 -->
		<!-- 底部开始 -->
		<div class="footer">
			<div class="copyright " style="text-align: center;">Copyright ©2020-现在 浩欣物联网平台</div>
		</div>
		<!-- 底部结束 -->
		<script type="text/javascript">
//			layui扩展模块的两种加载方式-示例
//		    layui.extend({
//			  admin: '{/}../../static/js/admin' // {/}的意思即代表采用自有路径，即不跟随 base 路径
//			});
//			//使用拓展模块
//			layui.use('admin', function(){
//			  var admin = layui.admin;
//			});
			layui.config({
			  base: '../static/js/'
			  ,version: '1'
			}).use('admin');
			layui.use(['jquery','admin'], function(){
				var $ = layui.jquery;
				$(function(){

					var userInfo = localStorage.getItem("userInfo")
					var user = JSON.parse(userInfo);
					// userInfo.user.user;
					var uname = user.user.username;

					var jwt = user.jwt;
					if(jwt){
						$.post("/inner/api/islogin",{"jwt":jwt,"userId":user.user.uid},function(data){
							if(data.retSig == 200){
								//判断当前jwt是否合法
								var str='<span>当前登录：'+uname+'</span>';
								$('#user_name').html(str);
								layui.element.init();
							}else{
								localStorage.removeItem("userInfo");
								window.location.href='login.html';
								return false;
							}
						});
					}else{
						localStorage.removeItem("userInfo");
						window.location.href='login.html';
						return false;
					}
				});
			});

		</script>
	</body>
	<!--Tab菜单右键弹出菜单-->
	<ul class="rightMenu" id="rightMenu">
        <li data-type="fresh">刷新</li>
        <li data-type="current">关闭当前</li>
        <li data-type="other">关闭其它</li>
        <li data-type="all">关闭所有</li>
    </ul>

</html>